<template>
  <div class="common-layout">
    <el-container class="main-container">
      <el-aside :width="isNavMenuFold ? '65px' : '201px'">
        <nav-aside :is-fold="isNavMenuFold"></nav-aside>
      </el-aside>
      <el-container>
        <el-header height="40px">
          <nav-header @foldChange="navFoldChange"></nav-header>
        </el-header>
        <el-main>
          <nav-main></nav-main>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import NavHeader from './header/NavHeader.vue'
import NavAside from './aside/NavAside.vue'
import NavMain from './main/NavMain.vue'
import { ref } from 'vue'

const isNavMenuFold = ref<boolean>()
const navFoldChange = (isFold: boolean) => {
  isNavMenuFold.value = isFold
}
</script>

<style lang="scss" scoped>
.common-layout {
  height: 100%;
}
.main-container {
  height: 100%;
  .el-aside {
    transition: width 0.5s ease;
  }
  .el-main {
    background-color: #f0f2f5;
  }
}
</style>
